import { defineStore } from 'pinia';
interface RecordItem {
  type: string;
  code: string;
  key: string;
  value: any;
}
export const useWebSocketStore = defineStore('websocket', {
  state: () => ({
    recordList: [] as RecordItem[],
  }),
  actions: {
    addRecord(record) {
      this.recordList[0] = JSON.parse(record);
    },
    clearRecords() {
      this.recordList = [];
    },
  },
});
